export default [
  // user
  {
    path: '/user',
    component: '../layouts/UserLayout',
    // authority: ['admin'],
    routes: [
      { path: '/user', redirect: '/user/login' },
      { path: '/user/login', name: 'login', component: './User/Login' },
      { path: '/user/register', name: 'register', component: './User/Register' },
      {
        path: '/user/register-result',
        name: 'register.result',
        component: './User/RegisterResult',
      },
      {
        component: '404',
      },
    ],
  },
  // app
  {
    path: '/',
    component: '../layouts/BasicLayout',
    Routes: ['src/pages/Authorized'],
    routes: [
      { path: '/', redirect: '/knowFlow/purchase',authority: ['admin', 'user', 'su']},
      {
        path: '/knowFlow',
        name: '知流向服务',
        icon: 'dashboard',
        routes: [
          { path: '/', redirect: '/knowFlow/purchase'},
          {
            name: '查询进购',
            path: '/knowFlow/purchase',
            component: './knowFlow/Purchase',
          },
          {
            name: '查询流向',
            path: '/knowFlow/flowTo',
            component: './knowFlow/FlowTo',
          },
          {
            name: '查询库存',
            path: '/knowFlow/stock',
            component: './knowFlow/Stock',
          },
          {
            name: '管理用户',
            path: '/knowFlow/AccountManagement',
            component: './knowFlow/AccountManagement',
            hideChildrenInMenu: true,
            authority: ['admin'],
            routes:[
              {
                name: '新建用户',
                pathname: 'newAccount',
                path: '/knowFlow/AccountManagement/newAccount',
                component: './knowFlow/AccountManagement/subMenuView/newAccount',
              }
            ]
          },
        ],
      },
      {
        component: '404',
      },
    ],
  },
];
